home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
hypercrd
/
hc1_2_x
/
stabilzr.sit
/
The Stabilizer
/
card_7443.txt
< prev
next >
Wrap
Text File
|
1989-02-05
|
19KB
|
654 lines
-- card: 7443 from stack: in
-- bmap block id: 5119
-- flags: 4000
-- background id: 2175
-- name: Year Totals
----- HyperTalk script -----
on arrowKey direction
if direction is "right" then
go card "about"
else
pass arrowKey
end if
end arrowkey
-- part 4 (field)
-- low flags: 01
-- high flags: 4002
-- rect: left=150 top=56 right=249 bottom=231
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: amounts
-- part 5 (field)
-- low flags: 01
-- high flags: 4002
-- rect: left=39 top=56 right=249 bottom=150
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: months
----- HyperTalk script -----
on mouseUp
put (item 2 of the clickLoc - 39) div 16 into whichLine
put the short name of the target into whichField
if line whichLine of card field whichField is empty then exit mouseUp
get line whichLine of card field whichField
visual barn door close slowly to gray
visual barn door open slowly
go card it
end mouseUp
-- part 6 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=150 top=262 right=279 bottom=231
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Total
-- part 11 (field)
-- low flags: 01
-- high flags: 4002
-- rect: left=235 top=56 right=249 bottom=316
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: balance
-- part 12 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=370 top=92 right=109 bottom=451
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: StartMonth
-- part 17 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=370 top=135 right=152 bottom=451
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: deposit/month
-- part 18 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=367 top=290 right=307 bottom=454
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Set Month
----- HyperTalk script -----
--Copyright ©1988 - Scott McGilliard - all rights reserved
on mouseUp
set cursor to 4
put line 1 of card field "startMonth" into noChange
get card field "Total"
delete char 1 of it
divide it by 12
put it into deposit
put card field "amounts" into tempAm
repeat with z = 1 to 12
delete char 1 of line z of tempAm
end repeat
repeat
answer "Should Mac choose the best month to start?" with "Help" or "No" or "Yes"
if it = "Help" then
push card
visual venetian blinds to gray
visual venetian blinds
go card "Choosing"
repeat until the mouse is down
end repeat
visual venetian blinds to gray
visual venetian blinds
pop card
else
exit repeat
end if
end repeat
if it = "No" then
set loc of msg to 18,15
put "Please click on the month you want to start your deposits."
set cursor to 3
repeat until the mouse is down
end repeat
set cursor to 4
put item 1 of the mouseLoc into temp1
put item 2 of the mouseLoc into temp2
if temp1 < 39 or temp1 > 150 then
hide msg
exit mouseUp
end if
if temp2 < 56 or temp2 > 249 then
hide msg
exit mouseUp
end if
if temp1 >= 39 and temp1 <= 150 then
put (temp2 - 39) div 16 into whichLine
if line whichLine of card field "months" is empty then
hide msg
exit mouseUp
end if
end if
if line whichLine of card field "months" = noChange then
hide msg
exit mouseUp
end if
set loc of msg to 19,106
put "This might take a minute, please wait."
put line whichLine of card field "months" into line 1 of card field "startMonth"
put whichLine into i
set numberFormat to "0.00"
put "0" into tempDep
repeat 12
add deposit to tempDep
put tempDep - line i of tempAm into line i of tempBal
put line i of tempBal into tempDep
if i = 12 then put 1 into i
else add 1 to i
end repeat
repeat with i = 1 to 12
put "$" before char 1 of line i of tempBal
end repeat
put tempBal into card field "balance" of card "Year Totals"
else
set cursor to 4
set loc of msg to 19,106
put "This might take a minute, please wait."
repeat with x =1 to 12
put x into i
put "0" into tempDep
repeat 12
add deposit to tempDep
put tempDep - line i of tempAm into item i of tempBal
put item i of tempBal into tempDep
if i = 12 then put 1 into i
else add 1 to i
end repeat
put min(tempBal) into item x of lowBal
end repeat
get max(lowBal)
repeat with i = 1 to 12
if it = item i of lowBal then exit repeat
end repeat
put "0" into tempDep
put line i of card field "months" into line 1 of card field "startMonth"
set numberFormat to "0.00"
repeat 12
add deposit to tempDep
put tempDep - line i of tempAm into line i of tempBal
put line i of tempBal into tempDep
if i = 12 then put 1 into i
else add 1 to i
end repeat
repeat with i = 1 to 12
put "$" before char 1 of line i of tempBal
end repeat
put tempBal into card field "balance"
end if
put line 1 of card field "startMonth" && "1," & last item of the long date into startDate
convert startDate to dateItems
get the date
convert it to dateItems
set numberFormat to "0"
if item 2 of it >= item 2 of startDate then add 1 to item 1 of startDate
convert startDate to date
convert startDate to seconds
put startDate into line 2 of card field "startMonth"
put line 3 of card field "startMonth" into whichBills
if whichBills Γëá empty then
put card field "months" into tempMonths
put line 1 of card field "startMonth" into starMon
if starMon = noChange then
hide msg
exit mouseUp
end if
repeat with i = 1 to the number of lines in tempMonths
if starMon = line i of tempMonths then exit repeat
end repeat
repeat with z = 1 to 12
put line i of tempMonths into line z of adjMonths
if i = 12 then
put "1" into i
else
add 1 to i
end if
end repeat
put item 1 of whichBills into bill
put field "months" of card bill into tempMonths
repeat with i = 1 to the number of lines in tempMonths
if starMon = line i of tempMonths then exit repeat
end repeat
repeat with x = 1 to the number of items in whichBills
put item x of whichBills into bill
repeat with z = 1 to 12
put line i of field "base" of card bill into line z of bas
put line i of field "amount" of card bill into line z of amo
put line i of field "projected" of card bill into line z of pro
put line i of field "actual" of card bill into line z of act
if i = 12 then
put "1" into i
else
add 1 to i
end if
end repeat
put word 1 of item 2 of the long date into thisMonth
repeat with i = 1 to the number of lines in adjMonths
if thisMonth = line i of adjMonths then exit repeat
end repeat
repeat with y = 1 to i
if line y of act = empty and line y of amo Γëá empty then
put line y of amo into line y of act
put line y of bas into line y of amo
end if
end repeat
put field "increase" of card bill into inc
delete last char of inc
repeat with y = (i + 1) to the number of lines in act
if line y of act Γëá empty then
put line y of amo into line y of bas
put line y of act into line y of amo
put empty into line y of act
end if
end repeat
get the long date
put starMon into word 1 of item 2 of it
convert it to dateItems
put item 2 of it into whichMonth
get the long date
convert it to dateItems
if item 2 of it = whichMonth then
put item 1 of it into field "thisYear1" of card bill
put item 1 of it into field "thisYear2" of card bill
put item 1 of it - 1 into field "lastYear" of card bill
else
if item 2 of it < whichMonth then
put item 1 of it - 1 && "-" && item 1 of it into field "thisYear1" of card bill
put item 1 of it - 1 && "-" && item 1 of it into field "thisYear2" of card bill
put item 1 of it - 2 && "-" && item 1 of it - 1 into field "lastYear" of card bill
else
put item 1 of it && "-" && item 1 of it + 1 into field "thisYear1" of card bill
put item 1 of it && "-" && item 1 of it + 1 into field "thisYear2" of card bill
put item 1 of it - 1 && "-" && item 1 of it into field "lastYear" of card bill
end if
end if
put bas into field "base" of card bill
put amo into field "amount" of card bill
put pro into field "projected" of card bill
put act into field "actual" of card bill
put adjMonths into field "months" of card bill
end repeat
end if
hide msg
end mouseUp
-- part 19 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=370 top=183 right=200 bottom=451
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: perPay
-- part 20 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=370 top=215 right=232 bottom=451
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Pays
-- part 21 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=367 top=262 right=279 bottom=454
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Set Pays
----- HyperTalk script -----
--Copyright ©1988 - Scott McGilliard - all rights reserved
on mouseUp
put card field "Total" into tempTotal
delete char 1 of tempTotal
ask "Please enter the number of pays per year" with word 1 of card field "pays"
if it is not empty then
put it into word 1 of card field "pays"
divide tempTotal by it
set numberFormat to "0.00"
put "$" & tempTotal into card field "perPay"
end if
end mouseUp
-- part 22 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=7 top=302 right=342 bottom=46
-- title width / last selected line: 0
-- icon id / first selected line: 11030 / 11030
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Home
----- HyperTalk script -----
on mouseUp
visual barn door close slowly to gray
visual dissolve
go stack "Home"
end mouseUp
-- part 24 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=63 top=290 right=307 bottom=207
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Recalculate Account
----- HyperTalk script -----
on mouseUp
doMath
end mouseUp
-- part 25 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=80 top=11 right=28 bottom=272
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: title
-- part 26 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=259 top=305 right=341 bottom=297
-- title width / last selected line: 0
-- icon id / first selected line: 26104 / 26104
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: HelpIndex
----- HyperTalk script -----
on mouseUp
push card
helpIndex
end mouseUp
-- part 27 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=469 top=307 right=339 bottom=506
-- title width / last selected line: 0
-- icon id / first selected line: 16816 / 16816
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: PopCard
----- HyperTalk script -----
on mouseUp
visual barn door close slowly to gray
visual barn door open slowly
pop card
end mouseUp
-- part 28 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=86 top=318 right=335 bottom=180
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Print Report
----- HyperTalk script -----
--Copyright ©1988 - Scott McGilliard - all rights reserved
on mouseUp
push card
set lockScreen to true
set cursor to 4
open printing
go card "printTotals"
put the date into card field "date" of card "printTotals"
put card field "title" of card "Year Totals" into card field "title" of card "printTotals"
put card field "amounts" of card "Year Totals" into card field "amounts" of card "printTotals"
put card field "total" of card "Year Totals" into card field "total" of card "printTotals"
put card field "balance" of card "Year Totals" into card field "balance" of card "printTotals"
put line 1 of card field "startMonth" of card "Year Totals" into card field "startMonth" of card "printTotals"
put card field "deposit/month" of card "Year Totals" into card field "deposit/month" of card "printTotals"
put card field "perPay" of card "Year Totals" into card field "perPay" of card "printTotals"
put card field "pays" of card "Year Totals" into card field "pays" of card "printTotals"
get field "expense" of card "Expenses"
put field "expense2" of card "Expenses" after it
put field "expense3" of card "Expenses" after it
put the number of lines of it into lineNum
put trunc(lineNum / 2) into linNum
if linNum * 2 = lineNum then
add 1 to linNum
else
add 2 to linNum
end if
put line linNum to lineNum of it into card field "expense2" of card "printList"
delete line linNum to lineNum of it
put it into card field "expense1" of card "printList"
set rect of card field "expense1" of card "printList" to 67,47,234,linNum * 11 + 47
set rect of card field "expense2" of card "printList" to 277,47,440,linNum * 11 + 47
print 2 cards
go card "printMonths"
put 2 into i
repeat 3
get field "monthName" of card i
put it && "- Total -" && field "subTotal" of card i into card field "month1" of card "printMonths"
put field "expense" of card i & return & field "expense2" of card i into card field "expense1" of card "printMonths"
get the number of lines of card field "expense1" of card "printMonths"
add 1 to it
set the rect of card field "expense1" of card "printMonths" to 0,12,160,(it * 11 + 12)
put field "amount" of card i & return & field "amount2" of card i into card field "amount1" of card "printMonths"
get the number of lines of card field "amount1" of card "printMonths"
add 1 to it
set the rect of card field "amount1" of card "printMonths" to 159,12,235,(it * 11 + 12)
add 1 to i
get field "monthName" of card i
put it && "- Total -" && field "subTotal" of card i into card field "month2" of card "printMonths"
put field "expense" of card i & return & field "expense2" of card i into card field "expense2" of card "printMonths"
get the number of lines of card field "expense2" of card "printMonths"
add 1 to it
set the rect of card field "expense2" of card "printMonths" to 277,12,437,(it * 11 + 12)
put field "amount" of card i & return & field "amount2" of card i into card field "amount2" of card "printMonths"
get the number of lines of card field "amount2" of card "printMonths"
add 1 to it
set the rect of card field "amount2" of card "printMonths" to 436,12,512,(it * 11 + 12)
add 1 to i
get field "monthName" of card i
put it && "- Total -" && field "subTotal" of card i into card field "month1" of card "printMonths2"
put field "expense" of card i & return & field "expense2" of card i into card field "expense1" of card "printMonths2"
get the number of lines of card field "expense1" of card "printMonths2"
add 1 to it
set the rect of card field "expense1" of card "printMonths2" to 0,12,160,(it * 11 + 12)
put field "amount" of card i & return & field "amount2" of card i into card field "amount1" of card "printMonths2"
get the number of lines of card field "amount1" of card "printMonths2"
add 1 to it
set the rect of card field "amount1" of card "printMonths2" to 159,12,235,(it * 11 + 12)
add 1 to i
get field "monthName" of card i
put it && "- Total -" && field "subTotal" of card i into card field "month2" of card "printMonths2"
put field "expense" of card i & return & field "expense2" of card i into card field "expense2" of card "printMonths2"
get the number of lines of card field "expense2" of card "printMonths2"
add 1 to it
set the rect of card field "expense2" of card "printMonths2" to 277,12,437,(it * 11 + 12)
put field "amount" of card i & return & field "amount2" of card i into card field "amount2" of card "printMonths2"
get the number of lines of card field "amount2" of card "printMonths2"
add 1 to it
set the rect of card field "amount2" of card "printMonths2" to 436,12,512,(it * 11 + 12)
add 1 to i
print 2 cards
end repeat
close printing
pop card
end mouseUp
-- part contents for card part 5
----- text -----
January
February
March
April
May
June
July
August
September
October
November
December
-- part contents for card part 4
----- text -----
$0
$0
$0
$0
$0
$0
$0
$0
$0
$0
$0
$0
-- part contents for card part 6
----- text -----
$0.00
-- part contents for card part 11
----- text -----
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
-- part contents for card part 17
----- text -----
$0.00
-- part contents for card part 20
----- text -----
24 Pays
-- part contents for card part 25
----- text -----
SUMMARY FOR 1988 - 1989
-- part contents for card part 19
----- text -----
$0.00
-- part contents for card part 12
----- text -----
January
2682460800
template